package com.example.hellospringbootstarterautoconfigure.config;

import com.example.hellospringbootstarterautoconfigure.controller.HelloController;
import com.example.hellospringbootstarterautoconfigure.properties.HelloProperties;
import com.example.hellospringbootstarterautoconfigure.service.HelloService;
import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;

/**
 * @author: lfh
 * @date: 2024/3/26 20:57
 * @Version: 1.0
 * @description:
 */
@Configuration
@ConditionalOnWebApplication
@EnableConfigurationProperties(HelloProperties.class)
@Import(HelloService.class)
public class HelloAutoConfiguration {

    @Bean
    public HelloController helloController() {
        return new HelloController();
    }
}

